package com.lzw.DailyAudit.mapper;


import com.baomidou.dynamic.datasource.annotation.DS;
import com.hooya.fa.eu.biz.DailyAudit.entity.CheckProfitBO;
import com.hooya.fa.eu.biz.DailyAudit.entity.ProfitCheckRecord;
import com.hooya.fa.eu.biz.DailyAudit.entity.ProfitStatement;
import com.hooya.fa.eu.biz.DailyAudit.entity.dto.ProfitCheckDTO;
import com.hooya.fa.eu.biz.DailyAudit.entity.dto.ProfitStatementDaily;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("fa_eu_daily")
public interface DailyProfitCheckMapper {

	@DS("fa_eu_daily")
	@Select("select id,sku,invoice_no as invoiceNo from profit_check where belongs = #{company}")
	List<ProfitStatement> getAllData(String company);

	@DS("fa_eu_daily")
	void batchSaveProfitCheck(@Param("list") List<ProfitStatement> list);

	@DS("fa_eu_daily")
	void batchSaveProfitCheckDaily(@Param("list") List<ProfitStatementDaily> list);

	@DS("fa_eu_daily")
	void batchSaveRecord(@Param("list") List<ProfitCheckRecord> list);

	@DS("fa_eu_daily")
	void batchUpdateProfitCheck(@Param("list") List<ProfitStatement> list);

	@DS("fa_eu_daily")
	List<CheckProfitBO> getCheckProfitList(@Param("date") String date);

	@DS("fa_eu_daily")
	void UpdateProfitCheck(@Param("data") ProfitStatement data);

	@DS("fa_eu_daily")
	List<ProfitCheckDTO> getDataByDate(String date);

	@DS("fa_eu_daily")
	@Delete("delete from fa_eu_daily.profit_check_daily where date = #{date}")
	void deleteProfitCheckDaily(String date);

	@DS("fa_eu_daily")
	@Delete("delete from fa_eu_daily.profit_check_record where date = #{date}")
	void deleteRecord(String date);


}
